﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.IO;

namespace KiemBao
{
    class TinhToan
    {
        public static ArrayList MathGame(int iGame)
        {
            ArrayList list = new ArrayList();
            for (int i = 0; i < iGame; i++)
            {
                for (int j = 0; j < iGame; j++)
                {
                    Node state = new Node();
                    state.NAME = i.ToString() + "-" + j.ToString();
                    state.X = i;
                    state.Y = j;
                    state.SUCCESS = new ArrayList();
                    if (i < (iGame - 1))
                    {
                        int num3 = i + 1;
                        state.SUCCESS.Add(num3.ToString() + "-" + j.ToString());
                    }
                    if (i > 0)
                    {
                        int num4 = i - 1;
                        state.SUCCESS.Add(num4.ToString() + "-" + j.ToString());
                    }
                    if (j < (iGame - 1))
                    {
                        int num5 = j + 1;
                        state.SUCCESS.Add(i.ToString() + "-" + num5.ToString());
                    }
                    if (j > 0)
                    {
                        int num6 = j - 1;
                        state.SUCCESS.Add(i.ToString() + "-" + num6.ToString());
                    }
                    list.Add(state);
                }
            }
            return list;
        }

    }
}
